//
//  MLZCommunityHFViewController.m
//  MotherLover
//
//  Created by lanou on 16/1/13.
//  Copyright © 2016年 zj. All rights reserved.
//

#import "MLZCommunityHFViewController.h"
#import "MLZLZCommunityTableViewCell.h"
#import "HcCustomKeyboard.h"
@interface MLZCommunityHFViewController ()<UITableViewDataSource,UITableViewDelegate,HcCustomKeyboardDelegate>
@property (nonatomic, strong)UITableView *HFTtableView;
@end

@implementation MLZCommunityHFViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
 
    [self addHFTtableView];
    [[HcCustomKeyboard customKeyboard] textViewShowView:self customKeyboardDelegate:self];
    
}
-(void)addHFTtableView{


    _HFTtableView  = [[UITableView alloc]initWithFrame:CGRectMake(0, 64, KW, KH-64) style:(UITableViewStylePlain)];
    _HFTtableView.delegate = self;
    _HFTtableView.dataSource = self;
   
    [self.view addSubview:_HFTtableView];


}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if(indexPath.row==0){
        return 200;
    }else{
    
        return 100;
    
    }




}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{


    return 10;


}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{


    static NSString *identifier =@"ZJCell";
    static NSString *indetifierP = @"PZJcell";
    if (indexPath.row==0){
        MLZLZCommunityTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
       
        if (!cell) {
            cell= [[MLZLZCommunityTableViewCell alloc]initWithStyle:(UITableViewCellStyleSubtitle) reuseIdentifier:identifier];
            
            
        }
        
        cell.modelPL= _modelC;
        return cell;
        
        
        
    }else{
        
        
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indetifierP];
        
        if (!cell) {
            cell= [[UITableViewCell alloc]initWithStyle:(UITableViewCellStyleSubtitle) reuseIdentifier:indetifierP];
                   }
        
        return cell;
        
        
        
    }






}
-(void)talkBtnClick:(UITextView *)textViewGet{

    if([BmobUser getCurrentUser]){
        BmobUser *user = [BmobUser getCurrentUser];
        
        NSString *ClassName = [NSString stringWithFormat:@"P%@_%ld_AM_", _objectID,(long)_index];
        
        
        
        
        BmobObject*object  = [BmobObject objectWithClassName:ClassName];
        [object setObject:textViewGet.text forKey:@"contents"];
        [object setObject:user.username forKey:@"userName"];
        //[object setObject:_titlefild.text forKey:@"title"];
        [object setObject: [NSString stringWithFormat:@"%ld", (long)_index] forKey:@"cellcount"];
         [object saveInBackgroundWithResultBlock:^(BOOL isSuccessful, NSError *error) {
             NSLog(@"%@",error);
         }];
        


    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
